package com.eastfair.venueservice.enumeration;

import com.eastfair.annotation.base.BaseEnum;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * <p>
 * 实体注释中生成的类型枚举
 * 服务预订项
 * </p>
 *
 * @author linan
 * @date 2023-03-07
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "ServiceBookingReportCheckStatusEnum", description = "报馆核定状态(搭建商预定服务专用) #{NOT_CHECK:未核定;HAS_CHECK:已核定-枚举")
public enum ServiceBookingReportCheckStatusEnum implements BaseEnum {

    /**
     * NOT_CHECK="未核定"
     */
    NOT_CHECK("未核定"),
    /**
     * HAS_CHECK="已核定"
     */
    HAS_CHECK("已核定"),
    ;

    @ApiModelProperty(value = "描述")
    private String desc;


    /**
     * 根据当前枚举的name匹配
     */
    public static ServiceBookingReportCheckStatusEnum match(String val, ServiceBookingReportCheckStatusEnum def) {
        return Stream.of(values()).parallel().filter(item -> item.name().equalsIgnoreCase(val)).findAny().orElse(def);
    }

    public static ServiceBookingReportCheckStatusEnum get(String val) {
        return match(val, null);
    }

    public boolean eq(ServiceBookingReportCheckStatusEnum val) {
        return val != null && eq(val.name());
    }

    @Override
    @ApiModelProperty(value = "编码", allowableValues = "NOT_CHECK,HAS_CHECK", example = "NOT_CHECK")
    public String getCode() {
        return this.name();
    }

}
